package domain.entities;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

@Entity
@Table(name = "mail", catalog = "bms")
public class Mail implements java.io.Serializable {

	// Fields
	private Integer id;
	private String email;
    private Compromisopais pais;

	// Constructors

	/** default constructor */
	public Mail() {
	}

	/** minimal constructor */
	public Mail(String email, Compromisopais pais) {
        this.email = email;
        this.pais = pais;
	}

    // Property accessors
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name = "email", nullable = false)
    public String getEmail() {
        return this.email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @ManyToOne()
    public Compromisopais getPais() {
        return this.pais;
    }

    public void setPais(Compromisopais pais) {
        this.pais = pais;
    }
}